
#import "ImageResources.h"

@interface ImageResources ()

@property (nonatomic)  NSMutableDictionary* images;

@end

@implementation ImageResources

+(instancetype) sharedInstance {
    static ImageResources* instance=nil;
    
    if(!instance){
        instance = [[super alloc] init];
        
        
    }
    return instance;
}

+(instancetype)alloc {
    return [ImageResources sharedInstance];
}

-(NSMutableDictionary *)images{
    //Lazy loading
    if(!_images){
        self.images = [NSMutableDictionary dictionary];
        [self.images setValue:@[@"white_circle.png"] forKey:@"FlyLevel"];
    }
    return _images;
}

//Returning the string for the file name
-(NSString*) imageWithKey : (NSString*) levelKey andWithIndex : (NSUInteger) arrayIndex {
     NSMutableArray* arr = [self.images objectForKey:levelKey];
    NSString* imagePath = [arr objectAtIndex:arrayIndex];
    
    return imagePath;
}


@end
